---@class Battle.ChainEffect :Battle.EffectBase
local ChainEffect = Battle.CreateClass("ChainEffect",Battle.EffectBase)
Battle.ChainEffect = ChainEffect

function ChainEffect:OnCreate()
    Battle.EffectBase.OnCreate(self)
    self.endPos = Vector3.New()
end
function ChainEffect:Set(startPos,endPos)
    self.pos:SetV(startPos)
    self.endPos:SetV(endPos)
    self:UpdateRay()
end
function ChainEffect:OnLoadFinished()
    ---@type CRayEffect
    self.cRay = self.obj:GetComponent(typeof(CRayEffect))
    if self.cRay == nil then
        logError(self.resName.."特效没有绑定CRayEffect脚本")
        return
    end
    self:UpdateRay()
end
function ChainEffect:UpdateRay()
    if not self.cRay then return end
    self.cRay:Set(self.pos.x,self.pos.y,self.pos.z,self.endPos.x,self.endPos.y,self.endPos.z)
end